<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            padding: 0;
            margin: 0;
        }
        .list{
            width: 1200px;
            margin: 100px auto;
            height: 50px;
            line-height: 50px;
        }
        .list li{
            border-bottom: 1px solid #CCC;
        }
        .list p{
            float: left;
        }

        .list div{
            float:right;
        }
        
        .list h3{
            float: left;
        }

        .list span{
            color: red;
            font-weight: bold;
        }
    </style>
</head>
<body>
    <% if(username){%>
        <p>尊敬的 <%=username%> 上午好
            <a href="/center">个人中心</a>
            <a href="/logout">退出登录</a>
        </p>
    <%}else{%>
        <p><a href="/login">登录</a></p>
   <%}%>
   <p><a href="/addgoods">添加商品</a></p>
   <ul class="list">
       <% arr.forEach(item=>{%>
            <li>
                <h3><%=item.name%></h3>
                <p><%=item.content%>
                <span>￥<%=item.price%></span>
                </p>
                <div>
                    <a href="/editgoods?id=<%=item._id%>">编辑</a>
                    <a href="/delgoods/<%=item._id%>">删除</a>
                </div>
            </li> 
       <%}) %>
   </ul>
</body>
</html>